package com.easy.dev.vo;

import com.easy.dev.bo.ResponseStatus;
import com.easy.dev.utils.I18nMessageUtil;
import lombok.Data;

@Data
public class Result<T> {
    private Integer status;
    private String msg;
    private T data;

    public Result() {

    }

    public Result(int status, String msg, T data) {
        this.status = status;
        this.msg = msg;
        this.data = data;
    }

    public Result(ResponseStatus responseStatus) {
        this.status = responseStatus.getStatus();
        this.msg = I18nMessageUtil.getMessage(responseStatus.getMsg(),"---");
    }

    public Result(ResponseStatus responseStatus, T data) {
        this.status = responseStatus.getStatus();
        this.msg = I18nMessageUtil.getMessage(responseStatus.getMsg(),"---");
        this.data = data;
    }
}
